//
//  CHFileManage.swift
//  bridging_js
//
//  Created by cyptt on 2021/8/20.
//

import UIKit

class JSdkFileManage: NSObject {

    
    static func saveImage(image: UIImage, persent: CGFloat, imageName: String) -> String {
        let data:Data? = image.jpegData(compressionQuality: persent)
        var filePath:String = ""
        if data != nil {
            filePath = JSdkFilePath.getDocument().appending("/"+imageName)
            print("----filepath---")
            print("002")
            let fileUrl:URL = URL.init(fileURLWithPath: filePath)
            do{
                try data?.write(to: fileUrl)
            }catch{
                
            }
            
        }
        print("003")
        
        return filePath;
        

    }
}
